﻿using BCCommon.Enums.Driver;
using BCCommon.Extensions;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.ComponentModel.DataAnnotations;

namespace BCDto.Location.Driver
{
    [BsonIgnoreExtraElements]
    public class DriverLocationBsonDto
    {
        public ObjectId Id { get; set; }
        /// <summary>
        /// 司机编号
        /// </summary>
        [Display(Name = "司机编号")]
        [BsonElement("DriverId")]
        public long DriverId { get; set; }

        /// <summary>
        /// 司机电话
        /// </summary>
        [Display(Name = "司机电话")]
        [BsonElement("Phone")]
        public string Phone { get; set; }

        /// <summary>
        /// 所在位置精度
        /// </summary>
        [Display(Name = "所在位置精度")]
        [BsonElement("Longitude")]
        public double Longitude { get; set; }

        /// <summary>
        /// 所在位置精维度
        /// </summary>
        [BsonElement("Coordinate")]
        public double[] Coordinate { get; set; }

        /// <summary>
        /// 所在位置纬度
        /// </summary>
        [Display(Name = "所在位置纬度")]
        [BsonElement("Latitude")]
        public double Latitude { get; set; }
        /// <summary>
        /// 车牌号
        /// </summary>
        [Display(Name = "车牌号")]
        [BsonElement("VehicleNo")]
        public string VehicleNo { get; set; }
        /// <summary>
        /// 司机名称
        /// </summary>
        [Display(Name = "司机名称")]
        [BsonElement("Name")]
        public string Name { get; set; }
        /// <summary>
        /// 司机头像
        /// </summary>
        [Display(Name = "司机头像")]
        [BsonElement("DriverPhotoPath")]
        public string DriverPhotoPath { get; set; }
        /// <summary>
        /// 车型Id
        /// </summary>
        [Display(Name = "车型Id")]
        [BsonElement("VehicleTypeId")]
        public int VehicleTypeId { get; set; }
        /// <summary>
        /// 车型名称
        /// </summary>
        [Display(Name = "车型名称")]
        [BsonElement("VehicleType")]
        public string VehicleType { get; set; }
        /// <summary>
        /// 所在城市编码
        /// </summary>
        [Display(Name = "所在城市编码")]
        [BsonElement("CityCode")]
        public string CityCode { get; set; }
        /// <summary>
        /// 所在区县编码
        /// </summary>
        [Display(Name = "所在区县编码")]
        [BsonElement("CountyCode")]
        public string CountyCode { get; set; }
        /// <summary>
        /// 剩余载重
        /// </summary>
        [Display(Name = "剩余载重")]
        [BsonElement("SurplusWeight")]
        public int SurplusWeight { get; set; }
        /// <summary>
        /// 位置更新时间
        /// </summary>
        [Display(Name = "位置更新时间")]
        [BsonElement("ModifyTime")]
        [BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime ModifyTime { get; set; }
        /// <summary>
        /// 工作状态
        /// </summary>
        [Display(Name = "工作状态")]
        [BsonElement("WorkingStatus")]
        public DriverWorkingStatus WorkingStatus { get; set; }
        /// <summary>
        /// 工作状态(工作中,休息中,已停运)
        /// </summary>
        [Display(Name = "工作状态(工作中,休息中,已停运)")]
        [BsonElement("WorkingStatusStr")]
        public string WorkingStatusStr
        {
            get
            {
                return this.WorkingStatus.GetDescriptionString();
            }
        }
        /// <summary>
        /// 车辆载重量
        /// </summary>
        [Display(Name = "车辆载重量")]
        [BsonElement("VehicleWeight")]
        public int VehicleWeight { get; set; }

        /// <summary>
        /// 车辆长度
        /// </summary>
        [Display(Name = "车辆长度")]
        [BsonElement("VehicleLength")]
        public decimal VehicleLength { get; set; }

        /// <summary>
        /// 车辆宽度
        /// </summary>
        [Display(Name = "车辆宽度")]
        [BsonElement("VehicleWidth")]
        public decimal VehicleWidth { get; set; }

        /// <summary>
        /// 车辆高度
        /// </summary>
        [Display(Name = "车辆高度")]
        [BsonElement("VehicleHeight")]
        public decimal VehicleHeight { get; set; }

        /// <summary>
        /// 车辆载货立方
        /// </summary>
        [Display(Name = "车辆载货立方")]
        [BsonElement("VehicleStere")]
        public decimal VehicleStere { get; set; }
        /// <summary>
        /// 信用值
        /// </summary>
        [Display(Name = "信用值")]
        [BsonElement("CreditScore")]
        public decimal? CreditScore { get; set; }
        /// <summary>
        /// 是否接收零担推送
        /// </summary>
        [Display(Name = "是否接收零担推送")]
        [BsonElement("IsReceivePartLoad")]
        public bool IsReceivePartLoad { get; set; }
        /// <summary>
        /// 日接单数
        /// </summary>
        [Display(Name = "日接单数")]
        [BsonElement("DailyReceivedOrders")] 
        public int DailyReceivedOrders { get; set; }

        /// <summary>
        /// 总接单数
        /// </summary>
        [Display(Name = "总接单数")]
        [BsonElement("TotalReceivedOrders")]
        public int TotalReceivedOrders { get; set; }

        /// <summary>
        /// 满载率
        /// </summary>
        [Display(Name = "满载率")]
        [BsonElement("FullLoadRatio")]
        public decimal FullLoadRatio { get; set; }



    }
}
